package com.sgb.knowledgeshare.view.adapter;

import android.content.Context;
import android.widget.TextView;
import com.sgb.knowledgeshare.BR;
import com.sgb.knowledgeshare.R;
import com.sgb.knowledgeshare.entity.MagessListEntity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import com.swgk.core.util.DateUtils;
import java.util.List;

/**
 * Created by：冯齐 on 2020/10/19 15:51
 * Description：系统消息
 */
public class MagessAdapter extends BaseRecycleAdapter<MagessListEntity.RecordsBean> {

    public MagessAdapter(Context context, List<MagessListEntity.RecordsBean> datas) {
        super(context, R.layout.item_share_magess, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, MagessListEntity.RecordsBean recordsBean) {
        holder.setBinding(BR.viewModel, recordsBean);
        TextView systemMagessContent = holder.itemView.findViewById(R.id.system_magess_content);
        TextView systemMagessTime = holder.itemView.findViewById(R.id.system_magess_time);
        systemMagessContent.setText(recordsBean.getMessageContent());
        systemMagessTime.setText(DateUtils.timestampTo13Date3(recordsBean.getCreateTime()));
    }
}
